package benchmark.util;

import com.google.gson.Gson;

/**
 * @Author: sjw
 * @Description:
 * @Date: 2018/7/19 8:00
 */

public class JsonHelper {
    private static Gson gson=new Gson();
    public static <T> String objectToJson(T obj){
        return gson.toJson(obj);
    }

    public static <T> T jsonToObject(String json, Class<T> classType){
        return gson.fromJson(json,classType);
    }

}
